﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StoreItemAdd.aspx.cs" Inherits="Admin_store_StoreItemAdd" ValidateRequest="false" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>50CMS后台框架</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="../css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/style.css?v=4.1.0" rel="stylesheet">
    <link href="../css/plugins/iCheck/custom.css" rel="stylesheet">
    <script src="../js/jquery.min.js?v=2.1.4"></script>
    <script type="text/javascript" src="../../js/jquery.form.js"></script>
    <script src="../js/bootstrap.min.js?v=3.3.6"></script>

        <!--ueditor富文本编辑框-->
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.js"></script>
   
        <link href="../Js/clockpicker/bootstrap-clockpicker.min.css" rel="stylesheet" />

</head>
<body class="gray-bg">
    <form id="form1" runat="server" class="form-horizontal m-t">
        <div class="wrapper animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">

                    <div class="tabs-container" style="margin-top: 1em;">


 <div class="tab-content"  >
                
                    <div class="ibox-content">
                        <div class="panel-body">
                            <div class="form-group">


                 

                                <div class="col-sm-12" style="margin-top: 1em;">
                                    <label class="col-sm-2 control-label"><%=Shopname%>茶室名称：</label>
                                    <div class="col-sm-6">
                                        <asp:TextBox ID="txtSname" runat="server" type="text" class="form-control" required=""
                                            aria-required="true" HintTitle="门店名称" HintInfo="茶室名称"></asp:TextBox>
                                    </div>
                                </div>



                                 <div class="col-sm-12" style="margin-top: 1em;">
                                    <label class="col-sm-2 control-label">可坐人数</label>
                                    <div class="col-sm-2">
                                        <asp:TextBox ID="people" runat="server" type="text" class="form-control" required=""
                                            aria-required="true" HintTitle="可坐人数" HintInfo="1-7人"></asp:TextBox>
                                    </div>



                                        <label class="col-sm-2 control-label">标签</label>
                                    <div class="col-sm-3">
                                        <asp:TextBox ID="tag" runat="server" type="text" class="form-control" required=""
                                            aria-required="true" HintTitle="标签" HintInfo="用逗号分割"></asp:TextBox>
                                    </div>

                                </div>





                                <div class="col-sm-12" style="margin-top: 1em;">
                                    <label class="col-sm-2 control-label">图片：</label>
                                    <div class="col-sm-6">
                                        <ul class="upload-ul clearfix">
                                            <li class="upload-pick">
                                                <div class="webuploader-container clearfix" id="goodsUpload" style="background: none;"></div>
                                            </li>
                                        </ul>
                                        <input type="text" id="xsimg" runat="server" value="" style="display: none;" />
                                        <input type="text" id="myimgTxt" runat="server" value="" style="display: none;" />
                                    </div>
                                    <span style="position: absolute; bottom: -3%; left: 19%;">建议尺寸670x380PX，jpg、jpeg格式，图片小于300kb</span>
                                </div>


                    

                                <div class="col-sm-12" style="margin-top: 1em;">
                                    <label class="col-sm-2 control-label">简介：</label>
                                    <div class="col-sm-6">

                                        <textarea id="txtSintroduce" cols="100" rows="8" style="width: 100%; height: 400px;" runat="server"></textarea>
                                        <script type="text/javascript">
                                            window.onload = function () {
                                                var ue = UE.getEditor('txtSintroduce');
                                            }
                                        </script>
                                    </div>
                                </div>

                           
                                  <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label">设备ID：</label>
                            <div class="col-sm-3">
                                <asp:TextBox ID="sbid" runat="server" type="text" class="form-control myday" required=""
                                    aria-required="true"   maxlength="20" HintTitle="ID" HintInfo="控制在50个字数内，如“页面头部”。"></asp:TextBox>
                            </div>
                        </div>



                         <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label">可预约天数范围：</label>
                            <div class="col-sm-1">
                                <asp:TextBox ID="txtDay" runat="server" type="text" class="form-control myday" required=""
                                    aria-required="true"   maxlength="10" HintTitle="可预约天数范围" HintInfo="控制在50个字数内，如“页面头部”。"></asp:TextBox>
                            </div>


                              <label class="col-sm-2 control-label">起订价格：</label>
                            <div class="col-sm-1">
                                <asp:TextBox ID="Textprice" runat="server" type="text" class="form-control myday" required=""
                                    aria-required="true"   maxlength="10" HintTitle="起订价格" HintInfo="订价格”。"></asp:TextBox>
                            </div>

                        </div>


                    <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label">预约时间段：</label>
                            <div class="col-sm-10">
                               	<span class="pull-left">选中可预约：</span>

  <div class="timebox">
   <div class="weekset">
    <input type="checkbox" name="week" class="i-checks" id="week1" value="1" runat="server" />
    <label class="checkbox-inline" for="week1"> 周一</label>
    <input type="checkbox" name="week" class="i-checks"  id="week2" value="2"  runat="server"/>
    <label class="checkbox-inline" for="week2"> 周二</label>
    <input type="checkbox" name="week" class="i-checks" id="week3" value="3"  runat="server" />
    <label class="checkbox-inline" for="week3"> 周三</label>
    <input type="checkbox" name="week" class="i-checks" id="week4" value="4"  runat="server"/>
    <label class="checkbox-inline" for="week4"> 周四</label>
    <input type="checkbox" name="week" class="i-checks"  id="week5" value="5"  runat="server"/>
    <label class="checkbox-inline" for="week5"> 周五</label>
    <input type="checkbox" name="week" class="i-checks" id="week6" value="6"  runat="server"/>
    <label class="checkbox-inline" for="week6"> 周六</label>
    <input type="checkbox" name="week" class="i-checks" id="week0" value="0"  runat="server"/>
    <label class="checkbox-inline" for="week0"> 周日</label>
   </div>

   <ul class="list-unstyled timelist clockpicker">
          <asp:Repeater ID="week" runat="server">
            <ItemTemplate>
            <li class="input-group" style="margin:10px 0">
                <span class="input-group-addon">时段</span>
                <input type="text" placeholder="0:00" class="form-control starttime"  value="<%#Eval("start")%>" style="background-color:#fff;" readonly="" onclick="settime(this)"/>
                <span class="input-group-addon">-</span>
                <input type="text" placeholder="1:00" class="form-control endtime" value="<%#Eval("end")%>" style="background-color:#fff;" readonly="" onclick="settime(this)"/>
                <span class="input-group-addon">价格</span>
                <input type="text" placeholder="价格" class="form-control item" value="<%#Eval("item")%>" />
                <span class="input-group-addon">可预约</span>
                <input type="number" placeholder="2" class="form-control number" value="<%#Eval("number")%>" />
                <span class="input-group-addon">人</span>
                <span class="input-group-btn">
                    <button class="btn btn-danger remove" type="button" onclick="remove(this)">删除</button></span>

            </li>      
            </ItemTemplate>
         </asp:Repeater>	
           


   </ul>
   <a class="btn btn-success btn-add" onclick="addtime()"><i class="fa fa-plus"></i> 添加时间段</a>

                            </div>
                        </div>


			 	</div>

                          <asp:TextBox ID="timeVue" runat="server" style="display:none"></asp:TextBox>
  


                  <div id="remove">

                        <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label">排除的日期：</label>
                            <div class="col-sm-10"  >
                          
                       <div class="col-sm-3"><input type="text" readonly="readonly" runat="server" onclick="showtime(this,1);" ID="datetime1" class="datetimepicker dayu form-control" name="remove[]" > </div>
                        <div class="col-sm-9"> <a href="javascript:;" onclick="delhouritem(this);"><i class="fa fa-times-circle" title="删除日期"> </i></a></div>    
                            </div>
                        </div>

                          
                        <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label">排除的日期：</label>
                            <div class="col-sm-10" >
                          
                       <div class="col-sm-3"><input type="text" readonly="readonly" runat="server"  onclick="showtime(this,2);" id="datetime2" class="datetimepicker dayu form-control" name="remove[]" > </div>
                        <div class="col-sm-9"> <a href="javascript:;" onclick="delhouritem(this);"><i class="fa fa-times-circle" title="删除日期"> </i></a></div>    
                            </div>
                       
                        </div>
                      

	             </div>



                       <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-10">
                             	<a href="javascript:;" id="remove-add" class="btn btn-success"><i class="fa fa-plus-circle"></i> 添加排除的日期</a>
							<div class="help-block">排除的日期前台不可预约，用于节假日休息使用</div>
                            </div>
                        </div>


                        
                          
                          
                          <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label">排除时间段：</label>
                            <div class="col-sm-6">
                               <div class="input-group">
                    	      <span class="input-group-addon">周一</span>
                                 
                                   <asp:TextBox ID="out1" runat="server" type="text" class="form-control" HintTitle="排除" HintInfo="12:30-13:30,18:30-20:30"></asp:TextBox>
                             </div>

                            </div>
                        </div>
                        <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-6">
                               <div class="input-group">
                    	      <span class="input-group-addon">周二</span>
                                    <asp:TextBox ID="out2" runat="server" type="text" class="form-control"  HintTitle="排除" HintInfo="12:30-13:30,18:30-20:30"></asp:TextBox>
                             </div>

                            </div>
                        </div>
                          <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-6">
                               <div class="input-group">
                    	      <span class="input-group-addon">周三</span>
                                   <asp:TextBox ID="out3" runat="server" type="text" class="form-control" HintTitle="排除" HintInfo="12:30-13:30,18:30-20:30"></asp:TextBox>
                             </div>

                            </div>
                        </div>
                          <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-6">
                               <div class="input-group">
                    	      <span class="input-group-addon">周四</span>
                                    <asp:TextBox ID="out4" runat="server" type="text" class="form-control" HintTitle="排除" HintInfo="12:30-13:30,18:30-20:30"></asp:TextBox>
                             </div>

                            </div>
                        </div>
                          <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-6">
                               <div class="input-group">
                    	      <span class="input-group-addon">周五</span>
                                    <asp:TextBox ID="out5" runat="server" type="text" class="form-control"  HintTitle="排除" HintInfo="12:30-13:30,18:30-20:30"></asp:TextBox>
                             </div>

                            </div>
                        </div>
                          <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-6">
                               <div class="input-group">
                    	      <span class="input-group-addon">周六</span>
                                    <asp:TextBox ID="out6" runat="server" type="text" class="form-control"  HintTitle="排除" HintInfo="12:30-13:30,18:30-20:30"></asp:TextBox>
                             </div>

                            </div>
                        </div>
                            <div class="col-sm-12" style="margin-top: 1em;">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-6">
                               <div class="input-group">
                    	      <span class="input-group-addon">周日</span>
                                    <asp:TextBox ID="out7" runat="server" type="text" class="form-control"  HintTitle="排除" HintInfo="12:30-13:30,18:30-20:30"></asp:TextBox>
                             </div>

                            </div>
                        </div>

                 
                                 <div class="form-group" style="margin-top: 2em;">
                                    <div class="col-sm-8 col-sm-offset-3" style="margin-top: 2em;">
                                        <asp:Button ID="Button1" runat="server" Text="确定" class="btn btn-primary" OnClick="Button1_Click" />
                                    </div>
                                </div>


                             </div>
                        </div>
                    </div>


                        </div>
                    </div>

            </div>

        </div>
   </div>   
    </form>


    <!-- 全局js -->

      <!-- 全局js -->
             <!-- iCheck -->
    <script src="../js/plugins/iCheck/icheck.min.js"></script>
    <script>
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green'

            });
        });
    </script>
  


       <script src="../50/function.js"></script>

      <script src="../Js/clockpicker/bootstrap-clockpicker.min.js"></script>

      <!-- 自定js -->


    <!-- 上传图片js -->
    <link href="/js/webUpload_Img/imgup.css" rel="stylesheet" />
    <script src="/js/webUpload_Img/mDialog.js"></script>
    <script src="/js/webUpload_Img/webUpload.js"></script>
    <script src="/js/webUpload_Img/webuploader.min.js"></script>
    <script src="/js/layer-v3.1.1/layer/layer.js"></script>
    <script>

        $(function () {
            $('#goodsUpload').diyUpload({
                picList: '<%=imgArr%>',
                picTxtList: '<%=imgTxtArr%>',
                IsBackImg: true,
                IsBackTxt: false,
                IsOneTmg: false,
                IsNotMod: false
            });
        });
        function setValue() {
            var myimg = "|";
            var myimgTxt = "|";
            $(".upload-ul").find('li').each(function (index, item) {
                if (typeof ($(this).attr("mya")) != "undefined" && $(this).attr("mya") != "NaN") {
                    myimg += $(this).attr("mya") + "|";
                    if (typeof ($(this).attr("title")) != "undefined")
                        myimgTxt += $(this).attr("title") + "|";
                    else
                        myimgTxt += "|";
                }
            });

            $("#xsimg").val(myimg);
            $("#myimgTxt").val(myimgTxt);
        }

   


// Manually toggle to the minutes view




 
        function settime(a) {
              $(a).clockpicker({autoclose: true});

        }

      


        if (typeof (Close) != "undefined") {
                layer.msg('保存成功，正在返回', {
                time: 2000, //20s后自动关闭 
                },function()
                {
                var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
                parent.layer.close(index); //执行关闭
                });       
        }


        function setValue() {

            var myimg = "|";
            var myimgTxt = "|";
            $(".upload-ul").find('li').each(function (index, item) {
                if (typeof ($(this).attr("mya")) != "undefined" && $(this).attr("mya") != "NaN") {
                    myimg += $(this).attr("mya") + "|";
                    if (typeof ($(this).attr("title")) != "undefined")
                        myimgTxt += $(this).attr("title") + "|";
                    else
                        myimgTxt += "|";
                }
            });

            $("#xsimg").val(myimg);
            $("#myimgTxt").val(myimgTxt);

		var value={times:[]};
		
		$(".timelist").find('li').each(function(){
			var row={};
			row.start=$(this).find('.starttime').val();
			row.end=$(this).find('.endtime').val();
			row.item=$(this).find('.item').val();
			row.number=$(this).find('.number').val();
			if(row.start && row.end && row.number){
				value.times.push(row);
			}
            });

            $("#timeVue").val(JSON.stringify(value.times));
            //alert(JSON.stringify(value.times));

	}


    function addtime(){
         
        var row =$('<li class="input-group" style="margin:10px 0">' +
				'<span class="input-group-addon">时段</span>' +
				'<input type="text" placeholder="0:00" class="form-control starttime" value="0:00"  style="background-color:#fff;" readonly onclick="settime(this)"/>' +
				'<span class="input-group-addon">-</span>' +
				'<input type="text" placeholder="1:00" class="form-control endtime" value="1:00"  style="background-color:#fff;" readonly onclick="settime(this)"/>' +
				'<span class="input-group-addon">价格</span>' +
				'<input type="text" placeholder="时间段价格" class="form-control item" value=""/>' +
				'<span class="input-group-addon">可预约</span>' +
				'<input type="number" placeholder="1" class="form-control number" value="1"/>' +
				'<span class="input-group-addon">人</span>' +
				'<span class="input-group-btn">' +
				'<button class="btn btn-danger remove" type="button" onclick="remove(this)">删除</button>' +
				'</span>' +
				'</li>');
		$(".timelist").append(row);

    }

     function remove(element){
         if (confirm('确定删除该时段?')) {
             $(element).parent().parent().remove();
			}
        }






     $('#remove-add').click(function(){
			var index = $('.dayu').length;
                           
             var rhtml = '<div class="col-sm-12" style="margin-top: 1em;">'+
                    '<label class="col-sm-2 control-label">排除的日期：</label>'+
                    '<div class="col-sm-10"  id="remove">' +
					' <div class="col-sm-3"><input type="text" readonly="readonly" onclick="showtime(this,'+index+');" id="datetime'+index+'" class="datetimepicker dayu form-control" name="remove[]" />'+
					'</div>'+
					'<div class="col-sm-9" style="padding-top:6px">'+
					'<a href="javascript:;" onclick="delhouritem(this);"><i class="fa fa-times-circle" title="删除日期"> </i></a>  </div>'+
					'</div>';
					$('#remove').append(rhtml);
        });



      

     

    

    </script>

    <!-- 自定js -->
    <script type="text/javascript" src="../js/layer/layer.js"></script>
    <script type="text/javascript">

        if (typeof (Close) != "undefined") {
            layer.msg('保存成功，正在返回', {
                time: 2000, //20s后自动关闭 
            }, function () {
                var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
                parent.layer.close(index); //执行关闭
            });
        }


    </script>
    <script src="../Js/plugins/layer/laydate/laydate.js"></script>

    <script type="text/javascript">
        laydate.skin('yalan')
        var start = {
            elem: "#txtSstime",
            format: "YYYY/MM/DD hh:mm:ss",
            max: "2099-06-16 23:59:59",
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas;
                end.start = datas
            }
        };
        var end = {
            elem: "#txtSetime",
            format: "YYYY/MM/DD hh:mm:ss",
            max: "2099-06-16 23:59:59",
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas;
                end.start = datas
            }
        };
        laydate(start);
        laydate(end);

    </script>

</body>
</html>
